package com.simtop.dao;

import com.simtop.pojo.Xt;
import com.simtop.pojo.experiment.Experiment;
import com.simtop.pojo.experiment.ExperimentDynamicVo;
import com.simtop.pojo.experiment.ExperimentReportVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author lvyongwei
 */
@Mapper
public interface ExperimentMapper {

    /**
     * 添加实验报告
     * @param experiment
     * @return
     */
    public boolean insertExperiment(Experiment experiment);

    /**
     * 修改实验报告
     * @param experiment
     * @return
     */
    public boolean updateExperiment(Experiment experiment);

    /**
     * 作品动态列表
     * @param message 关键字
     * @return
     */
    public List<ExperimentDynamicVo> getAllDynamic(String message);

    /**
     * 实验报告列表
     * @param userId
     * @param message 关键字
     * @return
     */
    public List<ExperimentReportVo> getAllReport(@Param("userId") Integer userId, @Param("message") String message);

    /**
     * 点赞和取消点赞使用的是redis，因此此处无用
     */
    /**
     * 点赞
     * @param userId
     * @param experimentId
     * @return
     */
    public boolean giveLike(@Param("userId")Integer userId,@Param("experimentId")Long experimentId);

    /**
     * 取消点赞
     * @param userId
     * @param experimentId
     * @return
     */
    public boolean unGiveLike(@Param("userId")Integer userId,@Param("experimentId")Long experimentId);

    /**
     * 删除实验报告
     * @param experimentId
     * @return
     */
    public boolean delete(Long experimentId);

    List<Xt> xtshow();

    void xtupdate(@Param("xtid") int xtid, @Param("xttitle") String xttitle,
                  @Param("xttype") String xttype, @Param("xtonly") String xtonly,
                  @Param("xtda") String xtda);
}
